# 09-for-in遍历.py
'''
    for 变量 in 遍历对象:
        
'''
# 1、使用for-in遍历一个list
list = ['a','b','c']
# 代码块只有一句可以连起来写
for x in list:print(x)
# 2、使用for-in遍历字符串
str = 'fnwekfkefjewewfekofoewfw'
for x in str:
    print(x)
# 3、break; 跳出循环
list1 = ['python','linux','打水晶头','java']
for x in list1:
    print(x)
    if x=='打水晶头': break
# 4、案例 请问你打螺丝吗？
while True:
    str = input('请问你吃螺蛳粉吗？')
    if str=='吃':break
# 5、for in 输出0-100
for a in range(101):print(a)

# 6、输出50-100
for a in range(50,101):print(a)

# 7、输出10-1 倒序 -1表示步长
for a in range(10,0,-1):print(a)
# 8、输出1-100 里面的3、6、9....
for a in range(3,101,3): print(a)
